package com.example.springbootwork.service.impl;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.springbootwork.entity.User;
import com.example.springbootwork.mapper.UserMapper;
import com.example.springbootwork.service.IUserSerivce;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Collection;
import java.util.Map;
import java.util.function.Function;

@Service
public class UserServiceImpl implements IUserSerivce {
    @Autowired
    private UserMapper userMapper;

    @Override
    public User selectById(Integer userId) {
        User user = userMapper.selectById(userId);
        return user;
    }

    @Override
    public boolean verifyPassword(Integer userId, String password) {
        User user = selectById(userId);
        return user.getPassword().equals(password);
    }

    @Override
    public String getUserRole(Integer userId) {
        String role = userMapper.getRoleNameByUserId(userId);
        return role;
    }

    @Override
    public boolean saveBatch(Collection entityList, int batchSize) {
        return false;
    }

    @Override
    public boolean saveOrUpdateBatch(Collection entityList, int batchSize) {
        return false;
    }

    @Override
    public boolean updateBatchById(Collection entityList, int batchSize) {
        return false;
    }

    @Override
    public boolean saveOrUpdate(Object entity) {
        return false;
    }

    @Override
    public Object getOne(Wrapper queryWrapper, boolean throwEx) {
        return null;
    }

    @Override
    public Map<String, Object> getMap(Wrapper queryWrapper) {
        return null;
    }

    @Override
    public BaseMapper getBaseMapper() {
        return null;
    }

    @Override
    public Class getEntityClass() {
        return null;
    }

    @Override
    public Object getObj(Wrapper queryWrapper, Function mapper) {
        return null;
    }
}
